﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpTRI
{
    class StatusAttributes
    {
        public uint StatPoints { get; set; }

        uint mLevel;
        public uint Level
        {
            get
            {
                return mLevel;
            }
            set 
            {
                mLevel = value;
                ComputeStatPoints(); 
            }
        }

        public uint Health { get; set; }
        public uint Damage { get; set; }

        public uint Strength { get; set; }
        public uint Agility { get; set; }
        public uint Vitality { get; set; }

        public uint MoveSpeed { get; set; }
        public uint AttackSpeed { get; set; }

        private void ComputeStatPoints()
        {
            StatPoints = Level * 2 + 1;
            StatPoints -= (Strength + Agility + Vitality);
        }

        public StatusAttributes()
        {
            Health = 100;
	        Damage = 15;
	        Strength = 1;
	        Agility = 1;
	        Vitality = 1;
	        MoveSpeed = 5;
            AttackSpeed = 1;
	        Level = 1;
        }

        public void LevelUp()
        {
            Level += 1;
            ComputeStatPoints();
        }

        public void TakeDamage(uint damage)
        {
            if (Health != 0)    
                Health -= damage;
        }
    }
}
